<template>
  <div class="fs-4 tc p-2" @click="toAdmin('/admin/login')">网站建设中...</div>
  <div class="p-4">
    <NSpace>
      <NButton quaternary v-for="menu in menus" :key="menu.url" @click="toPage(menu.url)">{{
        menu.text
      }}</NButton>
    </NSpace>
  </div>
</template>

<script setup lang="ts">
import { NButton, NSpace } from 'naive-ui'
import { useRouter } from 'vue-router'
const router = useRouter()

const toPage = (url: string) => {
  router.push(url)
}

const menus = [
  {
    text: '考试',
    url: '/exam',
  },
  {
    text: '游戏发行商',
    url: '/crud/gamepublisher',
  },
  {
    text: '游戏管理',
    url: '/crud/game',
  },
  {
    text: '软件分类',
    url: '/crud/softwaretype',
  },
  {
    text: '软件管理',
    url: '/crud/software',
  },
  {
    text: '电影管理',
    url: '/crud/movie',
  },
  {
    text: '电影排片',
    url: '/crud/moviescheduling',
  },
  {
    text: '足球俱乐部',
    url: '/crud/footballteam',
  },
  {
    text: 'cpu管理',
    url: '/crud/cpuinfo',
  },
  {
    text: '公告管理',
    url: '/crud/billboard',
  },
  {
    text: '用户首页',
    url: '/user/main',
  },
  {
    text: '登录',
    url: '/user/login',
  },
  {
    text: '新闻',
    url: '/news',
  },
  {
    text: '班级',
    url: '/class',
  },
  {
    text: '简易留言板',
    url: '/message',
  },
  {
    text: 'd1',
    url: '/done',
  },
]

let clickCount = 0

const toAdmin = (url: string) => {
  clickCount++
  if (clickCount === 3) {
    router.push(url)
    clickCount = 0 // 重置计数器（可选）
  }
}
</script>

<style scoped lang="scss"></style>
